Container

The CROWN Container provides an associative container for storing all kind of CROWN datatypes in (like objects, strings, booleans etc.).

Container.add(container, name, item, itemType)
Arguments:
  • container (Container)

  • name (string)

  • item (auto)

  • itemType (enum)

Return type:

boolean

Adds an item to the container.

Container.addConst(container, name, item, itemType)
Arguments:
  • container (Container)

  • name (string)

  • item (const auto)

  • itemType (enum)

Return type:

boolean

Adds a const-item to the container.

Container.clear(container)
Argument:

Clears the entire container.

Container.create()
Return type:

Container

Creates a new container.

Container.exists(container, name)
Arguments:
Return type:

boolean

Checks, if an item with the provided key string exists in the container.

Container.get(container, name, itemType)
Arguments:
  • container (Container)

  • name (string)

  • itemType (enum)

Return type:

auto

Gets an item from the container.

Container.getConst(container, name, itemType)
Arguments:
  • container (Container)

  • name (string)

  • itemType (enum)

Return type:

const auto

Gets a const-item from the container.

Container.getSize(container)
Argument:
Return type:

int

Returns the number of items in the container.

Container.getType(container, name)
Arguments:
Return type:

enum

Returns the type definition of the underlying type of item from the enum, as a string .

Container.isEmpty(container)
Argument:
Return type:

boolean

Checks, if the container is empty.

Container.isSingle(container, name)
Arguments:
Return type:

boolean

Checks, if the item with the provided key string is a single instance, in opposite to a vector-valued instance.

Container.isType(container, name, type)
Arguments:
  • container (Container)

  • name (string)

  • type (enum)

Return type:

boolean

Checks, if the item with the specified key string is of the specified type.

Container.isVector(container, name)
Arguments:
Return type:

boolean

Checks, if the item with the provided key string is a vector-valued instance, in opposite to a single instance.

Container.list(container)
Argument:
Return type:

string

Gets a list of all key names in the container, in alphabetical order.

Container.remove(container, name)
Arguments:
Return type:

boolean

Removes an item from the container. If there is no item with the provided key string, nothing is done and false is returned.

Container.toString(container)
Argument:
Return type:

string

Returns a string representation of the content of the container.

Container.update(container, name, item, itemType)
Arguments:
  • container (Container)

  • name (string)

  • item (auto)

  • itemType (enum)

Return type:

boolean

Updates an existing item in the container.

Container.updateConst(container, name, item, itemType)
Arguments:
  • container (Container)

  • name (string)

  • item (const auto)

  • itemType (enum)

Return type:

boolean

Updates an existing const-item in the container.